<#assign base=request.contextPath />
<!DOCTYPE html>
<div class="row">
	<div class="col-md-12 col-sm-12 col-xs-12">
		<div class="x_panel">
			<div class="x_title">
				<h2>农户审核 <small></small></h2>
				<div class="clearfix"></div>
			</div>
			<div class="x_content">
				<br/>
				<form id="postForm" data-parsley-validate class="form-horizontal form-label-left" method="post" action="${base}/gx/project/doCheck">
					<input type="hidden" id="id" name="id" value="${((obj.id)?c)!0 }">
					<input type="hidden" name="checkor" value="${(obj.checkor)!admin.userName}">
		            <input type="hidden" name="updateTime" value="${.now?string['yyyy-MM-dd HH:mm:ss']}">
		              <input type="hidden" name="checkTime" value="${.now?string['yyyy-MM-dd HH:mm:ss']}">
		            <input type="hidden" name="updator" value="${(obj.updator)!admin.userName}">
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">所属省 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        <input type="text" id="projectProvince" name="projectProvince" value="${(obj.projectProvince.cityName)!''}" class="form-control col-md-7 col-xs-12 " disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">所属市 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="projectCity" name="projectCity" value="${(obj.projectCity.cityName)!''}" class="form-control col-md-7 col-xs-12 " disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">所属县<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="projectDistrict" name="projectDistrict" value="${(obj.projectDistrict.cityName)!''}" class="form-control col-md-7 col-xs-12 " disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">项目地址 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="projectAddress" name="projectAddress" value="${(obj.projectAddress)!''}" class="form-control col-md-7 col-xs-12 " disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">代理商 <span class="required">*</span>
						</label>
						<div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="address" value="" class="form-control col-md-7 col-xs-12 " disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">业务员 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="lon" value="" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">项目名 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="projectName" name="projectName" value="${(obj.projectName)!''}" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">项目时长 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="startTime" name"startTime" value="${(obj.startTime)!''}" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">项目描述 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="projectDesc" name="projectDesc" value="${(obj.projectDesc)!''}" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">手机号 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="phone" value="${(obj.phone)!''}" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">农户名 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="user" name="user" value="${(obj.user.userName)!''}" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">排序 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="" value="" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">对应价格 <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="projectMoney" name="projectMoney" value="${(obj.projectMoney)!''}" class="form-control col-md-7 col-xs-12" readonly="readonly" disabled="disabled">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">项目图片 <span class="required">*</span>
                        </label>
                        <div style="float:left">
                            <div style="float:left;width: 150px;height: 150px; margin-left: 8px;" id="image1" ></div>
                            <div style="float:left;width: 150px;height: 150px; margin-left: 10px; " id="image2" ></div>
                            <div style="float:left;width: 150px;height: 150px; margin-left: 10px; "id="image3" ></div>
                            <div style="float:left;width: 150px;height: 150px; margin-left: 10px; "id="image4"></div>
                            <input type="hidden" id="projectImages" name="projectImages" value="${(obj.projectImages)!''}" class="form-control col-md-7 col-xs-12" readonly="readonly">
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">项目视屏 <span class="required">*</span>
                        </label>
                        <video src="${imagePath}${(obj.projectVideo)!''}" width="320" height="240" controls="controls">
						
						</video>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">审核结果<span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	通过：<input type="radio" class="flat" name="isChecked" value="1" <#if (obj.isChecked==1)>checked="checked"</#if>/>&nbsp;
                        	不通过：<input type="radio" class="flat" name="isChecked" value="2" <#if (obj.isChecked==2)>checked="checked"</#if>/>
                        </div>
					</div>
					<div class="form-group">
						<label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">不通过原因 <span class="required"></span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        	<input type="text" id="checkRemark" name="checkRemark" value="${(obj.checkRemark)!''}" class="form-control col-md-7 col-xs-12">
                        </div>
					</div>
					<div class="ln_solid"></div>
					<div class="form-group">
						<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
							<button type="button" class="btn btn-success" id="submit">保存</button>
							<button type="button" class="btn btn-primary" id="goBack">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
 
$(function() {
	var imagesPatr=$('#projectImages').attr("value")
	var splitArray = new Array();
	var regex = /#/;
   splitArray = imagesPatr.split(regex);
	
	for (i = 1; i < splitArray.length; i++) {	
	$("#image"+i).append("<img style='width:150px;hight:150px;' src='${imagePath}"+splitArray[i]+"'>")
		//$("#image"+i).css("background","${imagePath}"+splitArray[i])
		
	
	}
	
	
	

	//iCheck
	if ($("input.flat")[0]) {
		$(document).ready(function () {
	    	$('input.flat').iCheck({
	        	checkboxClass: 'icheckbox_flat-green',
	        	radioClass: 'iradio_flat-green'
	        });
	    });
	}
	// /iCheck

	laydate.render({elem: '#birth',type: 'date'});
	//select2


	$("#goBack").click(function() {
		$("#main_content").load('${base}/gx/project/list');	        
    });
	
	$("#submit").click(function() {
        $("#postForm").ajaxSubmit(function(data) {
    	 	if (data.flag) {
    	 		swal(data.msg, "", "success");
				$("#main_content").load('${base}/gx/project/list');
    	 	} 
    	 	else {
    	 		swal(data.msg, "", "error");
    	 	}
    	});
	});
});
</script>